Adwaita: make links readable in the dark variant
authorLapo Calamandrei <calamandrei@gmail.com>
Fri, 26 Sep 2014 15:05:17 +0000 (17:05 +0200)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 29 Sep 2014 18:41:49 +0000 (14:41 -0400)
And fix the messy style we have for *:link in the process.
https://bugzilla.gnome.org/show_bug.cgi?id=737386

gtk/resources/theme/Adwaita/_colors.scss
gtk/resources/theme/Adwaita/_common.scss
gtk/resources/theme/Adwaita/gtk-contained-dark.css
gtk/resources/theme/Adwaita/gtk-contained.css

index 3a6bbc39f5e903044e1e8f74eb5179ccb85ec470..d1fa4b6fc7385546021786a80591f48fe526ec59 100644 (file)
@@ -12,7 +12,10 @@ $selected_borders_color: if($variant=='light', darken($selected_bg_color, 30%),
                                                darken($selected_bg_color, 20%));
 $borders_color: if($variant =='light', darken($bg_color,30%), darken($bg_color,12%));
 $borders_edge: if($variant =='light', white, transparentize($fg_color, 0.9));
-$link_color: darken($selected_bg_color,10%);
+$link_color: if($variant == 'light', darken($selected_bg_color,10%),
+                                     lighten($selected_bg_color,20%));
+$link_visited_color: if($variant == 'light', darken($selected_bg_color,20%),
+                                     lighten($selected_bg_color,10%));
 $top_hilight: $borders_edge;
 
 $warning_color: #f57900;
index a63ba505812565a274b2050a3afad93be659448d..4d148d5913fd3b856aafe0e673c6d6e4df8f3cce 100644 (file)
@@ -29,7 +29,7 @@
   -GtkMenu-vertical-padding: 0;
 
   -GtkWidget-link-color: $link_color;
-  -GtkWidget-visited-link-color: $link_color;
+  -GtkWidget-visited-link-color: $link_visited_color;
 
   -GtkWidget-focus-padding: 2;    // FIXME: do we still need these?
   -GtkWidget-focus-line-width: 1; //
@@ -703,15 +703,25 @@ GtkColorButton.button {
  *********/
 
 *:link {
-  color: $selected_bg_color; //FIXME use a proper color
-  &:hover, &:active, &:visited {
-    color: mix($fg_color, $selected_bg_color, 40%); //FIXME same here
+  color: $link_color;
+  &:visited {
+    color: $link_visited_color;
+    *:selected & { color: mix($selected_fg_color, $selected_bg_color, 60%); }
+  }
+  &:hover {
+    color: lighten($link_color,10%);
+    *:selected & { color: mix($selected_fg_color, $selected_bg_color, 90%); }
+  }
+  &:active {
+    color: $link_color;
     *:selected & { color: mix($selected_fg_color, $selected_bg_color, 80%); }
   }
   &:backdrop, &:backdrop:hover, &:backdrop:hover:selected {
     color: $selected_bg_color;
   }
-  &:selected, *:selected & { color: $selected_fg_color; }
+  &:selected, *:selected & {
+    color: mix($selected_fg_color, $selected_bg_color, 80%);
+  }
 }
 
 .button:link, .button:visited {
@@ -1108,7 +1118,7 @@ GtkComboBox {
     padding-left: 12px;
     padding-right: 12px;
   }
-  
+
   // the following is for spacing the icon and the label inside the home button
   GtkLabel:last-child { padding-left: 2px; }
   GtkLabel:first-child { padding-right: 2px; }
@@ -1258,8 +1268,7 @@ GtkTreeView.view.progressbar { //Progressbar in treeview cells
     padding: 4px 8px;
     &:hover { //Seems like it :hover even with keyboard focus
       box-shadow: inset 0 -3px $selected_bg_color;
-      color: if($variant == 'light', $selected_bg_color,
-                                     lighten($selected_bg_color,15%));
+      color: $link_color;
     }
     &:insensitive {
       color: $insensitive_fg_color;
index 3d1d30d7073a791a3b6013b7c2670845a5bec4b6..07adc12a518538ee6ad3095c42ace3292a1c830f 100644 (file)
@@ -13,8 +13,8 @@
   -GtkTreeView-horizontal-separator: 4;
   -GtkMenu-horizontal-padding: 0;
   -GtkMenu-vertical-padding: 0;
-  -GtkWidget-link-color: #184472;
-  -GtkWidget-visited-link-color: #184472;
+  -GtkWidget-link-color: #4a90d9;
+  -GtkWidget-visited-link-color: #2a76c6;
   -GtkWidget-focus-padding: 2;
   -GtkWidget-focus-line-width: 1;
   -GtkDialog-button-spacing: 4;
@@ -1189,19 +1189,27 @@ GtkCalendar.header GtkColorButton.button.titlebutton {
 GtkCalendar.header .button.titlebutton:link, .button:visited, .header-bar .button.titlebutton:visited,
 .titlebar .button.titlebutton:visited,
 GtkCalendar.header .button.titlebutton:visited {
-  color: #215d9c; }
-  *:link:hover, .button:hover:link, .button:hover:visited, *:link:active, .button:active:link, .button:active:visited, *:link:visited, .button:visited, .header-bar .button.titlebutton:visited,
+  color: #4a90d9; }
+  *:link:visited, .button:visited, .header-bar .button.titlebutton:visited,
   .titlebar .button.titlebutton:visited,
   GtkCalendar.header .button.titlebutton:visited {
-    color: #7397bc; }
-    *:selected *:link:hover, *:selected .button:hover:link, *:selected .button:hover:visited, *:selected *:link:active, *:selected .button:active:link, *:selected .button:active:visited, *:selected *:link:visited, *:selected .button:visited {
+    color: #2a76c6; }
+    *:selected *:link:visited, *:selected .button:visited {
+      color: #a6bed7; }
+  *:link:hover, .button:hover:link, .button:hover:visited {
+    color: #74aae2; }
+    *:selected *:link:hover, *:selected .button:hover:link, *:selected .button:hover:visited {
+      color: #e8eef5; }
+  *:link:active, .button:active:link, .button:active:visited {
+    color: #4a90d9; }
+    *:selected *:link:active, *:selected .button:active:link, *:selected .button:active:visited {
       color: #d2deeb; }
   *:link:backdrop, .button:backdrop:link, .button:backdrop:visited, *:link:backdrop:hover, .button:backdrop:hover:link, .button:backdrop:hover:visited, *:link:backdrop:hover:selected, .button:backdrop:hover:selected:link, .button:backdrop:hover:selected:visited, .titlebar.selection-mode .subtitle:backdrop:hover:link, GtkCalendar.selection-mode.header .subtitle:backdrop:hover:link,
   .header-bar.selection-mode .subtitle:backdrop:hover:link {
     color: #215d9c; }
   *:link:selected, .button:selected:link, .button:selected:visited, .titlebar.selection-mode .subtitle:link, GtkCalendar.selection-mode.header .subtitle:link,
   .header-bar.selection-mode .subtitle:link, *:selected *:link, *:selected .button:link, *:selected .button:visited {
-    color: #ffffff; }
+    color: #d2deeb; }
 
 .button:link, .header-bar .button.titlebutton:link,
 .titlebar .button.titlebutton:link,
@@ -1887,7 +1895,7 @@ GtkTreeView.view.progressbar {
     padding: 4px 8px; }
     .menubar > .menuitem:hover {
       box-shadow: inset 0 -3px #215d9c;
-      color: #3583d5; }
+      color: #4a90d9; }
     .menubar > .menuitem:insensitive {
       color: #939695;
       box-shadow: none; }
index 0c4d7f3e7640d4fd1ca36ce447b1570042e0a1d6..c39fdcc41bb59bf1598b67c4288ed8fcc8441966 100644 (file)
@@ -14,7 +14,7 @@
   -GtkMenu-horizontal-padding: 0;
   -GtkMenu-vertical-padding: 0;
   -GtkWidget-link-color: #2a76c6;
-  -GtkWidget-visited-link-color: #2a76c6;
+  -GtkWidget-visited-link-color: #215d9c;
   -GtkWidget-focus-padding: 2;
   -GtkWidget-focus-line-width: 1;
   -GtkDialog-button-spacing: 4;
@@ -1181,19 +1181,27 @@ GtkCalendar.header GtkColorButton.button.titlebutton {
 GtkCalendar.header .button.titlebutton:link, .button:visited, .header-bar .button.titlebutton:visited,
 .titlebar .button.titlebutton:visited,
 GtkCalendar.header .button.titlebutton:visited {
-  color: #4a90d9; }
-  *:link:hover, .button:hover:link, .button:hover:visited, *:link:active, .button:active:link, .button:active:visited, *:link:visited, .button:visited, .header-bar .button.titlebutton:visited,
+  color: #2a76c6; }
+  *:link:visited, .button:visited, .header-bar .button.titlebutton:visited,
   .titlebar .button.titlebutton:visited,
   GtkCalendar.header .button.titlebutton:visited {
-    color: #3e6b97; }
-    *:selected *:link:hover, *:selected .button:hover:link, *:selected .button:hover:visited, *:selected *:link:active, *:selected .button:active:link, *:selected .button:active:visited, *:selected *:link:visited, *:selected .button:visited {
+    color: #215d9c; }
+    *:selected *:link:visited, *:selected .button:visited {
+      color: #b6d2ef; }
+  *:link:hover, .button:hover:link, .button:hover:visited {
+    color: #4a90d9; }
+    *:selected *:link:hover, *:selected .button:hover:link, *:selected .button:hover:visited {
+      color: #ecf3fb; }
+  *:link:active, .button:active:link, .button:active:visited {
+    color: #2a76c6; }
+    *:selected *:link:active, *:selected .button:active:link, *:selected .button:active:visited {
       color: #dae8f7; }
   *:link:backdrop, .button:backdrop:link, .button:backdrop:visited, *:link:backdrop:hover, .button:backdrop:hover:link, .button:backdrop:hover:visited, *:link:backdrop:hover:selected, .button:backdrop:hover:selected:link, .button:backdrop:hover:selected:visited, .titlebar.selection-mode .subtitle:backdrop:hover:link, GtkCalendar.selection-mode.header .subtitle:backdrop:hover:link,
   .header-bar.selection-mode .subtitle:backdrop:hover:link {
     color: #4a90d9; }
   *:link:selected, .button:selected:link, .button:selected:visited, .titlebar.selection-mode .subtitle:link, GtkCalendar.selection-mode.header .subtitle:link,
   .header-bar.selection-mode .subtitle:link, *:selected *:link, *:selected .button:link, *:selected .button:visited {
-    color: #ffffff; }
+    color: #dae8f7; }
 
 .button:link, .header-bar .button.titlebutton:link,
 .titlebar .button.titlebutton:link,
@@ -1881,7 +1889,7 @@ GtkTreeView.view.progressbar {
     padding: 4px 8px; }
     .menubar > .menuitem:hover {
       box-shadow: inset 0 -3px #4a90d9;
-      color: #4a90d9; }
+      color: #2a76c6; }
     .menubar > .menuitem:insensitive {
       color: #8d9091;
       box-shadow: none; }